﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BLLDeNeI.Funcionalidad;

namespace DeNeI
{
    public partial class FrmPrincipal : Form
    {
        public FrmPrincipal()
        {
            InitializeComponent();
        }

        private void TraerPersonas()
        {
            BLLDocumento bllDocumento = new BLLDocumento();
            bsDocumento.DataSource = bllDocumento.Buscar(txtDNI.Text, txtApellidos.Text, txtNombres.Text);

            int total = bllDocumento.Buscar("", "", "").Count;
            grpPersonas.Text = string.Format("Personas: {0}/{1}", dgvPersonas.Rows.Count, total);
        }


        private void FrmPrincipal_Load(object sender, EventArgs e)
        {
            TraerPersonas();
        }

        private void btnBuscar_Click(object sender, EventArgs e)
        {
            TraerPersonas();
        }

        private void btnCargarNuevo_Click(object sender, EventArgs e)
        {

        }

        private void btnEditar_Click(object sender, EventArgs e)
        {

        }

        private void btnEliminar_Click(object sender, EventArgs e)
        {

        }

        private void btnVerArchivo_Click(object sender, EventArgs e)
        {

        }

        private void txtNombres_KeyPress(object sender, KeyPressEventArgs e)
        {
            TraerPersonas();
        }
    }
}
